using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity;
using ByHand.Model;

namespace ByHand.Data
{
    public class ByHandDB : DbContext
    {

        public ByHandDB(string connectionString)
            : base(connectionString) { }
        public IDbSet<Product> Products { get; set; }
        public IDbSet<Provider> Providers { get; set; }
        public IDbSet<Order> Orders { get; set; }
        public IDbSet<Manager> Managers { get; set; }
        public IDbSet<City> Cities { get; set; }
        public IDbSet<District> Districts { get; set; }
        public IDbSet<OrderLog> OrderLogs { get; set; }
        public IDbSet<ProductOption> ProductOptions { get; set; }
        public IDbSet<User> Users { get; set; }
        public IDbSet<OrderDetail> OrderDetails { get; set; }
        public IDbSet<SmsLog> SmsLogs { get; set; }
        public IDbSet<Log> Logs { get; set; }
        public IDbSet<GuuAttributeProduct> GuuAttributeProducts { set; get; }

        public virtual IDbSet<T> DbSet<T>() where T : class
        {
            return Set<T>();
        }

        public virtual void Commit()
        {
            base.SaveChanges();
        }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
        }
    }
}
